<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Editor Template</title>
<style type="text/css">@import url("file:/home/moovida/rcpdevelopment/eclipse/configuration/org.eclipse.osgi/bundles/488/1/.cp/book.css");</style>
<style type="text/css">@import url("file:/home/moovida/rcpdevelopment/eclipse/configuration/org.eclipse.osgi/bundles/505/1/.cp/schema.css");</style>
</HEAD>
<BODY>
<H1 style="text-align:center">Editor Template</H1>
<p></p>
<h6 class="CaptionFigColumn SchemaHeader">Identifier: </h6>org.eclipse.ui.editors.templates<p></p>
<h6 class="CaptionFigColumn SchemaHeader">Since: </h6>3.0
<p></p>

<h6 class="CaptionFigColumn SchemaHeader">Description: </h6>Templates are snippets of text or code which help the user enter reoccurring patterns into a text editor. Templates may contain variables which are resolved in the context where the template is inserted.<p></p>
<h6 class="CaptionFigColumn SchemaHeader">Configuration Markup:</h6>
<p></p>
<p class="code SchemaDtd">&lt;!ELEMENT <a name="e.extension">extension</a> (<a href="#e.template">template</a>* , <a href="#e.resolver">resolver</a>* , <a href="#e.contextType">contextType</a>* , <a href="#e.include">include</a>* , <a href="#e.contextTypeRegistry">contextTypeRegistry</a>*)&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST extension</p>
<p class="code SchemaDtdAttlist">point&nbsp;CDATA #REQUIRED</p><p class="code SchemaDtdAttlist">id&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</p><p class="code SchemaDtdAttlist">name&nbsp;&nbsp;CDATA #IMPLIED</p>&gt;</p>
<p></p>
<ul class="ConfigMarkupAttlistDesc">
<li><b>point</b> - a fully qualified identifier of the target extension point</li>
<li><b>id</b> - an optional identifier of the extension instance</li>
<li><b>name</b> - an optional name of the extension instance</li>
</ul>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.contextType">contextType</a> EMPTY&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST contextType</p>
<p class="code SchemaDtdAttlist">id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</p><p class="code SchemaDtdAttlist">class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</p><p class="code SchemaDtdAttlist">name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</p><p class="code SchemaDtdAttlist">registryId&nbsp;IDREF #IMPLIED</p>&gt;</p>
<p></p>
<p class="ConfigMarkupElementDesc">
A context type defines a context within which templates are evaluated. A context type uses its resolvers to resolve a template.</p>
<br>
<ul class="ConfigMarkupAttlistDesc">
<li><b>id</b> - unambiguously identifies this context type. Use of a qualified name is recommended.</li>
<li><b>class</b> - a subclass of <code>org.eclipse.jface.text.templates.TemplateContextType</code></li>
<li><b>name</b> - the display name of this context</li>
<li><b>registryId</b> - the id of the context type registry where this context type is automatically registered. Since 3.5.</li>
</ul>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.resolver">resolver</a> EMPTY&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST resolver</p>
<p class="code SchemaDtdAttlist">contextTypeId&nbsp;IDREF #REQUIRED</p><p class="code SchemaDtdAttlist">type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</p><p class="code SchemaDtdAttlist">class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</p><p class="code SchemaDtdAttlist">description&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</p><p class="code SchemaDtdAttlist">name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</p><p class="code SchemaDtdAttlist">icon&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</p>&gt;</p>
<p></p>
<p class="ConfigMarkupElementDesc">
A template variable resolver can resolve a template variable in a certain context.</p>
<br>
<ul class="ConfigMarkupAttlistDesc">
<li><b>contextTypeId</b> - references the context type that this resolver is contributed to</li>
<li><b>type</b> - the type of this variable resolver. This property will be set on the resolver once it gets created.</li>
<li><b>class</b> - a subclass of <code>org.eclipse.jface.text.templates.TemplateVariableResolver</code></li>
<li><b>description</b> - the description of this variable resolver. This property will be set on the resolver once it gets created.</li>
<li><b>name</b> - the display name of this resolver</li>
<li><b>icon</b> - an icon that may be displayed in the user interface</li>
</ul>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.template">template</a> (<a href="#e.pattern">pattern</a>)&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST template</p>
<p class="code SchemaDtdAttlist">id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</p><p class="code SchemaDtdAttlist">contextTypeId&nbsp;IDREF #REQUIRED</p><p class="code SchemaDtdAttlist">name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</p><p class="code SchemaDtdAttlist">description&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</p><p class="code SchemaDtdAttlist">icon&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</p><p class="code SchemaDtdAttlist">autoinsert&nbsp;&nbsp;&nbsp;&nbsp;(true | false) "true"</p>&gt;</p>
<p></p>
<p class="ConfigMarkupElementDesc">
A template is a snippet of code or text that will be evaluated in a given context. Variables which will be resolved in that context can be specified using the <tt>${variable_type}</tt> notation.</p>
<br>
<ul class="ConfigMarkupAttlistDesc">
<li><b>id</b> - unambiguously identifies this template. Use of a qualified name is recommended.</li>
<li><b>contextTypeId</b> - references the context type that this template is contributed to</li>
<li><b>name</b> - the internationalizable name of the template which will show up in the UI, such as in template proposals</li>
<li><b>description</b> - the description of this template</li>
<li><b>icon</b> - an icon that may be displayed in the UI for this template, for example in content assist proposals</li>
<li><b>autoinsert</b> - <code>true</code> (default) to make the template automatically insertable, <code>false</code> to not allow automatic insertion. Since 3.1.</li>
</ul>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.pattern">pattern</a> (#PCDATA)&gt;</p>
<p></p>
<p class="ConfigMarkupElementDesc">
The template pattern.</p>
<br><br>
<p class="code SchemaDtd">&lt;!ELEMENT <a name="e.include">include</a> EMPTY&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST include</p>
<p class="code SchemaDtdAttlist">file&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</p><p class="code SchemaDtdAttlist">translations&nbsp;CDATA #IMPLIED</p>&gt;</p>
<p></p>
<p class="ConfigMarkupElementDesc">
A collection of templates encoded as XML can be included as a whole via this element.</p>
<br>
<ul class="ConfigMarkupAttlistDesc">
<li><b>file</b> - the XML file to import templates from</li>
<li><b>translations</b> - an optional properties file with resources for the templates specified in <tt>file</tt>.
<br>
<em>Note:</em> The translation files are not treated as resource bundles and hence the file name has to be left as is i.e. do not add the  locale to the file name. The translated files must be in the 'nl' directory i.e. if a [plugin] defines a template translations file in its plugin.xml like:
<pre class="Example"><span class="code SchemaTag">
...
  translations=$nl$/[plugin-relative path to file]
...
</span></pre>
then the translations must go into:
<pre class="Example"><span class="code SchemaTag">
  [plugins nl fragment]/nl/[locale]/templates/[plugin-relative path to file]
</span></pre></li>
</ul>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.contextTypeRegistry">contextTypeRegistry</a> EMPTY&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST contextTypeRegistry</p>
<p class="code SchemaDtdAttlist">id&nbsp;CDATA #IMPLIED</p>&gt;</p>
<p></p>
<p class="ConfigMarkupElementDesc">
Defines a registry for context types. Context types which define a 'registryId' are automatically added to the registry which is created by <code>new org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry(registryId)</code>. Since 3.5.</p>
<br>
<ul class="ConfigMarkupAttlistDesc">
<li><b>id</b> - the id of this registry</li>
</ul>
<br><h6 class="CaptionFigColumn SchemaHeader">Examples: </h6><pre class="Example"><span class="code SchemaTag">
   &lt;extension
         point=</span><span class="code SchemaCstring">&quot;org.eclipse.ui.editors.templates&quot;</span><span class="code SchemaTag">&gt;
      &lt;template
         name=</span><span class="code SchemaCstring">&quot;%ant.tasks.javac.name&quot;</span><span class="code SchemaTag">
         contextTypeId=</span><span class="code SchemaCstring">&quot;org.eclipse.ui.examples.templateeditor.antcontext&quot;</span><span class="code SchemaTag">
         id=</span><span class="code SchemaCstring">&quot;org.eclipse.ui.examples.templateeditor.templates.javac&quot;</span><span class="code SchemaTag">
         description=</span><span class="code SchemaCstring">&quot;%ant.tasks.javac.description&quot;</span><span class="code SchemaTag">&gt;
          &lt;pattern&gt;
             &lt;javac srcdir=</span><span class="code SchemaCstring">&quot;${src}&quot;</span><span class="code SchemaTag">
               destdir=</span><span class="code SchemaCstring">&quot;${dst}&quot;</span><span class="code SchemaTag">
               classpath=</span><span class="code SchemaCstring">&quot;${classpath}&quot;</span><span class="code SchemaTag">
               debug=</span><span class="code SchemaCstring">&quot;${debug}&quot;</span><span class="code SchemaTag">/&gt;
          &lt;/pattern&gt;
      &lt;/template&gt;
      
      &lt;resolver
         contextTypeId=</span><span class="code SchemaCstring">&quot;org.eclipse.ui.examples.templateeditor.antcontext&quot;</span><span class="code SchemaTag">
         type=</span><span class="code SchemaCstring">&quot;src&quot;</span><span class="code SchemaTag">
         class=</span><span class="code SchemaCstring">&quot;org.eclipse.ui.examples.templateeditor.editors.AntVariableResolver&quot;</span><span class="code SchemaTag">&gt;
      &lt;/resolver&gt;
      
      &lt;resolver
         contextTypeId=</span><span class="code SchemaCstring">&quot;org.eclipse.ui.examples.templateeditor.antcontext&quot;</span><span class="code SchemaTag">
         type=</span><span class="code SchemaCstring">&quot;dst&quot;</span><span class="code SchemaTag">
         class=</span><span class="code SchemaCstring">&quot;org.eclipse.ui.examples.templateeditor.editors.AntVariableResolver&quot;</span><span class="code SchemaTag">&gt;
      &lt;/resolver&gt;
   &lt;/extension&gt;
</span></pre>
<p></p>

<h6 class="CaptionFigColumn SchemaHeader">API Information: </h6>See the <code>org.eclipse.jface.text.templates</code> package in the <tt>org.eclipse.text</tt> plug-in for the relevant API.
<p></p>

<h6 class="CaptionFigColumn SchemaHeader">Supplied Implementation: </h6>See the <code>org.eclipse.jface.text.templates</code> package in the <tt>org.eclipse.text</tt> plug-in for the relevant classes.
<p></p>

<br>
<p class="note SchemaCopyright">
Copyright (c) 2001, 2009 IBM Corporation and others.<br>
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>

</p>
</BODY>
</HTML>
